
<script>
$(document).ready(function () {

$("#form1").submit( function () {
	var s_num = parseInt($("#send_num").val());
	var l_num = parseInt($("#last_number").html());
	{%if $smarty.get.high_replacement_id%}
	if(s_num>l_num){
		alert('数量不能超过剩余数量');
		return false;

	}
	{%/if%}
	if($("#send_num").val()==0 || isNaN(s_num)){
		alert('数量不能为空');
		return false;
		
	}

	if($("#materials_no").val()==''){
		alert('物资编码不能为空');
		return false;
		
	}

	if($("#part_number").val()==''){
		alert('部件号不能为空');
		return false;
		
	}

	if($("#materials_name").val()==''){
		alert('物资名称不能为空');
		return false;
		
	}


} ); 
})

	
</script>

<form action="index.php?c=zy_send_storehouse_details&m={%$act%}&post=1" method=post name=frm enctype="multipart/form-data" id="form1">	
<table width="90%" name="tab_form" id="tab_form" class="tab_form" align="left" border="0" cellpadding="0" cellspacing="1">
<tbody>
<tr>
	<td width="20%" class="tab_bold">物资编码</td>
	<td><input type=text name="materials_no" id="materials_no" size=30 {%if $smarty.get.high_replacement_id%}value="{%$high_one.materials_no%}"{%else%}value='{%$materials_no%}'{%/if%}><input type="hidden" name="send_record_id" value="{%$smarty.get.send_record_id%}">&nbsp;<a href="index.php?c=zy_high_replacement&m=get_high&send_record_id={%$smarty.get.send_record_id%}">高额配件列表</td>
</tr>
<tr>
	<td width="20%" class="tab_bold">部件号</td>
	<td><input type=text name="part_number" id="part_number" size=30 
	{%if $smarty.get.high_replacement_id%}
	value="{% $high_one.part_number %}"
	{%else%} 
	value='{%$part_number%}'
	{%/if%}
	></td>
</tr>
<tr>
	<td width="20%" class="tab_bold">物资名称</td>
	<td><input type=text name="materials_name" id="materials_name" size=30 
	{%if $smarty.get.high_replacement_id%}
	value="{% $high_one.materials_name %}"
	{%else%} 
	value='{%$materials_name%}'
	{%/if%}
	></td>
</tr>
<tr>
	<td width="20%" class="tab_bold">规格型号</td>
	<td><input type=text name="format_model" size=30 
	{%if $smarty.get.high_replacement_id%}
	value="{% $high_one.format_model %}"
	{%else%} 
	value="{% $format_model %}"
	{%/if%}
	></td>
</tr>
<tr>
	<td width="20%" class="tab_bold">数量</td>
	<td><input type=text name="send_num" id="send_num" size=30 value='{%$send_num%}'>
	{%if $smarty.get.high_replacement_id%}
	<font color="red">数量最多不能超过<span id="last_number" >{% $high_one.last_number %}</span></font>

	<input type="hidden" name="high_replacement_id" value="{%$smarty.get.high_replacement_id%}">
	{%/if%}
	</td>
</tr>
<tr>
	<td width="20%" class="tab_bold">单位</td>
	<td><input type=text name="s_unit" size=30 value='{%$s_unit%}'></td>
</tr>
<tr>
	<td width="20%" class="tab_bold">订单号</td>
	<td><input type=text name="order_no" size=30 value='{% $order_no %}'></td>
</tr>
<tr>
<td width="20%" class="tab_bold">项目</td>
	<td>
	<select name="project_id">
		{%html_options options=$project_arr selected=$project_id%}
	</select>
	</td>
</tr>
<tr>
	<td width="20%" class="tab_bold">备注</td>
	<td><textarea cols="70" rows="4" id="contactus" name="remarks" ></textarea></td>
</tr>
<tr>
	<td class="tab_bold">附件名称</td>
	<td><input type="file" name="file_name" id="file_name" size="40" /></td>
</tr>

<tr>
	<td colspan=4 align=center>
		<input type=hidden name='details_id' id='details_id' value='{%$details_id%}'>
		<input type=submit value="提交" class="btn_form">&nbsp;&nbsp;
		<input type=reset value="重置" class="btn_form">
	</td>
</tr>
</tbody>
</table>
</form>